package cn.yqn.org.domain;

import cn.yqn.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    // 编号
    private String sn;
    // 名称
    private String name;
    // 上级部门路径
    private String dirPath;
    // 状态
    private Integer state;

    // 部门领导id  (employee)
    private Long manager_id;

    // employee对象  领导  manager_id
    private Employee manager;

    // 上级部门id
    private Long parent_id;
    private Department parent;

    // 子部门级联显示字段
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 为空则不返回数据
    private List<Department> children = new ArrayList<>();

}
